class IndexNowModel {
  int code;
  List<Data> data;

  IndexNowModel({this.code, this.data});

  IndexNowModel.fromJson(Map<String, dynamic> json) {
    code = json['code'];
    if (json['data'] != null) {
      data = new List<Data>();
      json['data'].forEach((v) {
        data.add(new Data.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['code'] = this.code;
    if (this.data != null) {
      data['data'] = this.data.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class Data {
  String name;
  String open;
  String preClose;
  String price;
  String high;
  String low;
  String bid;
  String ask;
  String volume;
  String amount;
  String b1V;
  String b1P;
  String b2V;
  String b2P;
  String b3V;
  String b3P;
  String b4V;
  String b4P;
  String b5V;
  String b5P;
  String a1V;
  String a1P;
  String a2V;
  String a2P;
  String a3V;
  String a3P;
  String a4V;
  String a4P;
  String a5V;
  String a5P;
  String date;
  String time;
  String code;

  Data(
      {this.name,
        this.open,
        this.preClose,
        this.price,
        this.high,
        this.low,
        this.bid,
        this.ask,
        this.volume,
        this.amount,
        this.b1V,
        this.b1P,
        this.b2V,
        this.b2P,
        this.b3V,
        this.b3P,
        this.b4V,
        this.b4P,
        this.b5V,
        this.b5P,
        this.a1V,
        this.a1P,
        this.a2V,
        this.a2P,
        this.a3V,
        this.a3P,
        this.a4V,
        this.a4P,
        this.a5V,
        this.a5P,
        this.date,
        this.time,
        this.code});

  Data.fromJson(Map<String, dynamic> json) {
    name = json['name'];
    open = json['open'];
    preClose = json['pre_close'];
    price = json['price'];
    high = json['high'];
    low = json['low'];
    bid = json['bid'];
    ask = json['ask'];
    volume = json['volume'];
    amount = json['amount'];
    b1V = json['b1_v'];
    b1P = json['b1_p'];
    b2V = json['b2_v'];
    b2P = json['b2_p'];
    b3V = json['b3_v'];
    b3P = json['b3_p'];
    b4V = json['b4_v'];
    b4P = json['b4_p'];
    b5V = json['b5_v'];
    b5P = json['b5_p'];
    a1V = json['a1_v'];
    a1P = json['a1_p'];
    a2V = json['a2_v'];
    a2P = json['a2_p'];
    a3V = json['a3_v'];
    a3P = json['a3_p'];
    a4V = json['a4_v'];
    a4P = json['a4_p'];
    a5V = json['a5_v'];
    a5P = json['a5_p'];
    date = json['date'];
    time = json['time'];
    code = json['code'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['name'] = this.name;
    data['open'] = this.open;
    data['pre_close'] = this.preClose;
    data['price'] = this.price;
    data['high'] = this.high;
    data['low'] = this.low;
    data['bid'] = this.bid;
    data['ask'] = this.ask;
    data['volume'] = this.volume;
    data['amount'] = this.amount;
    data['b1_v'] = this.b1V;
    data['b1_p'] = this.b1P;
    data['b2_v'] = this.b2V;
    data['b2_p'] = this.b2P;
    data['b3_v'] = this.b3V;
    data['b3_p'] = this.b3P;
    data['b4_v'] = this.b4V;
    data['b4_p'] = this.b4P;
    data['b5_v'] = this.b5V;
    data['b5_p'] = this.b5P;
    data['a1_v'] = this.a1V;
    data['a1_p'] = this.a1P;
    data['a2_v'] = this.a2V;
    data['a2_p'] = this.a2P;
    data['a3_v'] = this.a3V;
    data['a3_p'] = this.a3P;
    data['a4_v'] = this.a4V;
    data['a4_p'] = this.a4P;
    data['a5_v'] = this.a5V;
    data['a5_p'] = this.a5P;
    data['date'] = this.date;
    data['time'] = this.time;
    data['code'] = this.code;
    return data;
  }
}